import request from '@/utils/ruizhiRequest'
// 创建一个定制板块
export const CreateNewFlexBlock = (data) => {
  return request({
    url: '/v1/admin/flexdatalib/block/create/',
    method: 'post',
    data,
  })
}

// 获取所有板块
export const RetrieveFlexBlock = () => {
  return request({
    url: '/v1/admin/flexdatalib/block/retrieve/',
    method: 'get',
  })
}

// 新建用户板块
export const CreateUserFlexBlock = (data) => {
  return request({
    url: '/v1/admin/flexdatalib/blockUser/create/',
    method: 'post',
    data,
  })
}

// 获取用户板块
export const RetrieveUserFlexBlock = (uid) => {
  return request({
    url: '/v1/admin/flexdatalib/blockUser/retrieve/',
    method: 'get',
    params: { uid },
  })
}

// 获取用户板块下的品种
export const RetrieveUserBlockVariety = (uid, bid) => {
  return request({
    url: '/v1/admin/flexdatalib/blockVarietyUser/retrieve/',
    method: 'get',
    params: { uid, bid },
  })
}

// 添加用户板块下的品种
export const CreateUserBlockVariety = (data) => {
  return request({
    url: '/v1/admin/flexdatalib/blockVarietyUser/create/',
    method: 'post',
    data,
  })
}
// 查询用户的定制指标
// export const RetrieveUserFlexIndex = (uid, bid, ven) => {
//   return request({
//     url: '/v1/admin/flexdatalib/indexUser/retrieve/',
//     method: 'get',
//     params: { uid, bid, ven },
//   })
// }

// // 添加用户的定制指标
// export const CreateUserFlexIndex = (data) => {
//   return request({
//     url: '/v1/admin/flexdatalib/indexUser/create/',
//     method: 'post',
//     data,
//   })
// }
// 创建板块内的指标组
export const CreateBlockIndexGroup = (data) => {
  return request({
    url: '/v1/admin/flexdatalib/blockIndexGroup/create/',
    method: 'post',
    data,
  })
}
// 查询板块内的指标组
export const RetrieveBlockIndexGroup = (bid) => {
  return request({
    url: '/v1/admin/flexdatalib/blockIndexGroup/retrieve/',
    method: 'get',
    params: { bid },
  })
}

// 创建板块组内指标
export const CreateBlockGroupIndex = (data) => {
  return request({
    url: '/v1/admin/flexdatalib/blockGroupIndex/create/',
    method: 'post',
    data,
  })
}

// 查询板块组内指标
export const RetrieveBlockGroupIndex = (bgid, ven) => {
  return request({
    url: '/v1/admin/flexdatalib/blockGroupIndex/retrieve/',
    method: 'get',
    params: { bgid, ven },
  })
}

// 创建用户定制的数据组
export const CreateBlockGroupUser = (data) => {
  return request({
    url: '/v1/admin/flexdatalib/blockIndexGroupUser/create/',
    method: 'post',
    data,
  })
}

// 查询用户定制的数据组
export const RetrieveBlockGroupUser = (uid, bid) => {
  return request({
    url: '/v1/admin/flexdatalib/blockIndexGroupUser/retrieve/',
    method: 'get',
    params: { uid, bid },
  })
}
